﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QLKHO.Class;
using System.Data.SqlClient;

namespace QLKHO.Forms
{
    public partial class frmNhanVien : Form
    {
        public frmNhanVien()
        {
            InitializeComponent();
            this.nHANVIENTableAdapter.Fill(this.qLKHODataSet.NHANVIEN);
            clsMain.flexConn.InitForms(this.Tag.ToString(), this, qLKHODataSet.NHANVIEN);
            clsMain.flexConn.InitForms(this.Tag.ToString(), ref fcButton1);
            clsMain.flexConn.InitForms(this.Tag.ToString(), ref dataGridView1);
            clsMain.flexConn.KhoiTaoXMLTable(this.Tag.ToString(), qLKHODataSet.NHANVIEN);
        }

        private void frmNhanVien_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'qLKHODataSet.LOAINHANVIEN' table. You can move, or remove it, as needed.
            this.lOAINHANVIENTableAdapter.Fill(this.qLKHODataSet.LOAINHANVIEN);
            // TODO: This line of code loads data into the 'qLKHODataSet.NHANVIEN' table. You can move, or remove it, as needed.
            

        }

        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            clsMain.flexConn.AddDataToControls(this.Tag.ToString(), e.RowIndex, qLKHODataSet.NHANVIEN);
        }

        private void fcButton1_Click(object sender, EventArgs e)
        {
            clsMain.flexConn.ButtonsClick(this.Tag.ToString(), fcButton1.intState);
            nHANVIENTableAdapter.Update(qLKHODataSet.NHANVIEN);
        }
    }
}
